/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.repository.model.project;

import cn.ac.nercis.pes.common.utils.JsonUtils;
import cn.ac.nercis.pes.repository.constant.BaseConstants;
import cn.ac.nercis.pes.repository.model.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;

import java.time.LocalDate;

/**
 * 系统测评基础信息实体类
 * @author zpy
 * @version 1.0.0
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "pes_system_evaluation")
public class SystemEvaluationDO extends BaseEntity {
    @Id
    @GenericGenerator(name = "generator",strategy = BaseConstants.CUSTOM_UUID_STRATEGY)
    @GeneratedValue(generator = "generator")
    @Column(name = "id",unique = true,nullable = false,length = 36)
    private String id;

    @Column(name = "system_id",length = 36,nullable = false)
    private String systemId;

    @Column(name = "is_change")
    private Boolean isChange;
    @Column(name = "change_desc")
    private String changeDesc;

    @Column(name = "cii_state",length = 36)
    private String ciiState;
    @Column(name = "cii_desc")
    private String ciiDesc;

    @Column(name = "grade_protection_state",length = 36)
    private String gradeProtectionState;
    @Column(name = "evaluation_unit_name")
    private String evaluationUnitName;
    @Column(name = "evaluation_date")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDate evaluationDate;
    @Column
    private String conclusion;

    @Column(name = "service_range",length = 128)
    private String serviceRange;
    @Column(name = "inter_provincial_count")
    private Integer interProvincialCount;
    @Column(name = "inter_area_count")
    private Integer interAreaCount;
    @Column(name = "service_range_desc")
    private String serviceRangeDesc;
    @Column(name = "service_scope",length = 128)
    private String serviceScope;
    @Column(name = "service_scope_desc")
    private String serviceScopeDesc;
    @Column(name = "service_object",length = 128)
    private String serviceObject;
    @Column(name = "service_object_desc")
    private String serviceObjectDesc;

    @Column(length = 128)
    private String coverage;
    @Column(name = "coverage_desc")
    private String coverageDesc;
    @Column(name = "network_nature",length = 128)
    private String networkNature;
    @Column(name = "network_nature_desc")
    private String networkNatureDesc;

    @Column(name = "service_user_count")
    private String serviceUserCount;
    @Column(name = "is_running")
    private Boolean isRunning;
    @Column(name = "run_year")
    private String runYear;
    @Column(name = "run_month")
    private String runMonth;
    @Column(name = "run_desc",length = 500)
    private String runDesc;

    @Column(length = 128)
    private String interconnection;
    @Column(name = "interconnection_desc")
    private String interconnectionDesc;
    @Column(name = "net_name")
    private String netName;

    @Column(name = "cloud_state",length = 36)
    private String cloudState;
    @Column(name = "cloud_name")
    private String cloudName;
    @Column(name = "cloud_select_state",length = 36)
    private String cloudSelectState;
    @Column(name = "cloud_unit")
    private String cloudUnit;
    @Column(name = "cloud_date")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDate cloudDate;
    @Column(name = "cloud_con")
    private String cloudCon;

    @Column(name = "pa_scheme",length = 128)
    private String paScheme;
    @Column(name = "pa_pass_date")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDate passDate;
    @Column(name = "pa_scheme_method",length = 128)
    private String paSchemeMethod;
    @Column(name = "pa_scheme_unit",length = 128)
    private String paSchemeUnit;

    @Column(name = "pp_situation",length = 128)
    private String ppSituation;
    @Column(name = "pp_situation_count")
    private Integer ppSituationCount;
    @Column(name = "pp_situation_independent_count")
    private Integer ppSituationIndependentCount;
    @Column(name = "pp_situation_shared_count")
    private Integer ppSituationSharedCount;
    @Column(name = "pp_situation_certified_count")
    private Integer ppSituationCertifiedCount;
    @Column(name = "pp_situation_uncertified_count")
    private Integer ppSituationUnCertifiedCount;
    @Column(name = "pp_situation_foreign_count")
    private Integer ppSituationForeignCount;

    @Column(name = "grouping_algorithm",length = 128)
    private String groupingAlgorithm;
    @Column(name = "grouping_algorithm_desc")
    private String groupingAlgorithmDesc;
    @Column(name = "asymmetric_algorithm",length = 128)
    private String asymmetricAlgorithm;
    @Column(name = "asymmetric_algorithm_desc")
    private String asymmetricAlgorithmDesc;
    @Column(name = "hash_algorithm",length = 128)
    private String hashAlgorithm;
    @Column(name = "hash_algorithm_desc")
    private String hashAlgorithmDesc;
    @Column(name = "sequence_algorithm",length = 128)
    private String sequenceAlgorithm;
    @Column(name = "sequence_algorithm_desc")
    private String sequenceAlgorithmDesc;
    @Column(name = "other_algorithm_desc")
    private String otherAlgorithmDesc;

    @Override
    public String toString() {
        return this.getClass().getSimpleName().concat(JsonUtils.toJson(this));
    }
}